<?php
/**
 * Slipstream :: Highly adaptive dependency injection framework
 * Copyright 2010-2011 Ian Unruh (Xerof3ar)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace Slipstream\Configuration;
use Terrafirma\Type\AbstractEnumeration;

/**
 * Represents the scope of the context tree that is affected by
 * a certain policy
 *
 * Additional scopes can be added by extending this enumeration and rolling
 * your own ScopeAnalyzerInterface, if the built-in ones do not cover
 * certain use cases.
 *
 * @author Ian Unruh (Xerof3ar) <ianunruh@gmail.com>
 * @since Class avaliable since release 1.0
 */
class PolicyScope extends AbstractEnumeration
{
	/**
	 * Affects any nearby contexts (policies in the root context)
	 */
	const All = 'all';
	
	/**
	 * Affects any identifiers that share a relatioship with the
	 * identifier of the context the policy is bound to
	 */
	const InheritByChildren = 'inheritByChildren';
	
	/**
	 * Affects any identifiers that share a relatioship with the
	 * identifier of the context the policy is bound to; limited to
	 * contexts that are siblings of that context.
	 */
	const InheritBySiblings = 'inheritBySiblings';
	
	/**
	 * Affects only the context that it is bound to
	 */
	const Local = 'local';
	
	/**
	 * Reference polices are used only for aliasing and informational
	 * purposes; they are discarded when policies are gathered during the
	 * collection stage of an activation session
	 */
	const Reference = 'reference';
}